package com.netease.c;

import java.util.Enumeration;
import java.util.Hashtable;

public class c
{
  public static final Hashtable a = new Hashtable();

  static
  {
    a.put("&lt;", "<");
    a.put("&gt;", ">");
    a.put("&amp;", "&");
    a.put("&ldquo;", "\"");
    a.put("&rdquo;", "\"");
    a.put("&quot;", "\"");
    a.put("&nbsp;", " ");
    a.put("&emsp;", " ");
    a.put("&ensp;", " ");
    a.put("&times;", "×");
    a.put("&divide;", "÷");
    a.put("&copy;", "??");
    a.put("&reg;", "??");
    a.put("??", "??");
  }

  private static int a(char[] paramArrayOfChar, int paramInt, char paramChar)
  {
    if (paramInt < paramArrayOfChar.length)
      if (paramArrayOfChar[paramInt] != paramChar);
    while (true)
    {
      return paramInt;
      paramInt++;
      break;
      paramInt = -1;
    }
  }

  private static int a(char[] paramArrayOfChar, int paramInt, String paramString)
  {
    char[] arrayOfChar = paramString.toCharArray();
    int i;
    if (paramInt < paramArrayOfChar.length - arrayOfChar.length)
    {
      i = 0;
      label17: if (i >= arrayOfChar.length)
        break label65;
      if (paramArrayOfChar[(paramInt + i)] == arrayOfChar[i]);
    }
    label65: for (int j = 0; ; j = 1)
    {
      if (j != 0);
      while (true)
      {
        return paramInt;
        i++;
        break label17;
        paramInt++;
        break;
        paramInt = -1;
      }
    }
  }

  private static g a(char[] paramArrayOfChar, int paramInt, boolean paramBoolean)
  {
    g localg;
    if (paramInt >= paramArrayOfChar.length)
      localg = null;
    while (true)
    {
      return localg;
      if (paramArrayOfChar[paramInt] == '<')
      {
        int j = a(paramArrayOfChar, paramInt + 1, '>');
        if (j == -1)
        {
          localg = new g(0, paramArrayOfChar, paramInt, paramArrayOfChar.length, paramBoolean);
          continue;
        }
        String str1 = new String(paramArrayOfChar, paramInt, 1 + (j - paramInt));
        if (str1.startsWith("<!--"))
        {
          int n = a(paramArrayOfChar, paramInt + 1, "-->");
          if (n == -1)
          {
            localg = new g(1, paramArrayOfChar, paramInt, paramArrayOfChar.length, paramBoolean);
            continue;
          }
          localg = new g(1, paramArrayOfChar, paramInt, n + 3, paramBoolean);
          continue;
        }
        String str2 = str1.toLowerCase();
        if (str2.startsWith("<style"))
        {
          int m = a(paramArrayOfChar, paramInt + 1, "</style>");
          if (m == -1)
          {
            localg = new g(4, paramArrayOfChar, paramInt, paramArrayOfChar.length, paramBoolean);
            continue;
          }
          localg = new g(4, paramArrayOfChar, paramInt, m + 9, paramBoolean);
          continue;
        }
        if (str2.startsWith("<script"))
        {
          int k = a(paramArrayOfChar, paramInt + 1, "</script>");
          if (k == -1)
          {
            localg = new g(3, paramArrayOfChar, paramInt, paramArrayOfChar.length, paramBoolean);
            continue;
          }
          localg = new g(3, paramArrayOfChar, paramInt, k + 9, paramBoolean);
          continue;
        }
        localg = new g(2, paramArrayOfChar, paramInt, paramInt + str1.length(), paramBoolean);
        continue;
      }
      int i = a(paramArrayOfChar, paramInt + 1, '<');
      if (i == -1)
      {
        localg = new g(0, paramArrayOfChar, paramInt, paramArrayOfChar.length, paramBoolean);
        continue;
      }
      localg = new g(0, paramArrayOfChar, paramInt, i, paramBoolean);
    }
  }

  public static String a(String paramString)
  {
    StringBuffer localStringBuffer1 = new StringBuffer(paramString.length());
    char[] arrayOfChar = paramString.toCharArray();
    int i = 0;
    StringBuffer localStringBuffer2 = localStringBuffer1;
    boolean bool = false;
    while (true)
    {
      g localg = a(arrayOfChar, i, bool);
      if (localg == null)
        return localStringBuffer2.toString();
      bool = localg.b();
      localStringBuffer2.append(localg.c());
      if ((localg.toString().startsWith("</p")) || (localg.toString().startsWith("</br")) || (localg.toString().startsWith("</div")))
        localStringBuffer2 = localStringBuffer2.append("\n");
      i += localg.a();
    }
  }

  public static String b(String paramString)
  {
    Enumeration localEnumeration = a.keys();
    if (localEnumeration.hasMoreElements())
    {
      String str = (String)localEnumeration.nextElement();
      int i;
      for (paramString = b.a(paramString, str, (String)a.get(str)); ; paramString = paramString.substring(0, i) + a.get(str) + paramString.substring(i + str.length()))
      {
        i = paramString.indexOf(str);
        if (i == -1)
          break;
      }
    }
    return paramString;
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.c.c
 * JD-Core Version:    0.6.0
 */